package cn.wh.context.support;

import cn.wh.beans.factory.support.DefaultListableBeanFactory;
import cn.wh.beans.factory.xml.XmlBeanDefinitionReader;

/**
 * @Author wanghao
 * @Date 2022-09-03 15:33
 * @Description: TODO
 */
public abstract class AbstractXmlApplicationContext extends AbstractRefreshableApplicationContext  {

    @Override
    protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) {
        XmlBeanDefinitionReader beanDefinitionReader=new XmlBeanDefinitionReader(beanFactory,this);
        String[] configLocations = getConfigLocations();
        if (configLocations!=null){
            beanDefinitionReader.loadBeanDefinitions(configLocations);
        }
    }
    protected abstract String[] getConfigLocations();
}
